//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by Fernflower decompiler)
//

package com.restaurant.application.minifacade.data;

import com.google.common.collect.Lists;
import com.nebutown.generation.Convert;
import com.nebutown.generation.PickableBean;
import java.util.List;
import java.util.stream.Collectors;

public class CouponListPadBO implements PickableBean {
    public static final String FN_TOTALRECORD = "totalRecord";
    public static final String FN_LISTS = "lists";
    public static final List<String> FIELD_NAMES = Lists.newArrayList(new String[]{"totalRecord", "lists"});
    private Long totalRecord;
    private List<CouponPadBO> lists;

    public CouponListPadBO(Long totalRecord, List<CouponPadBO> lists) {
        this.setTotalRecord(totalRecord);
        this.setLists(lists);
    }

    public CouponListPadBO() {
    }

    public CouponListPadBO duplicate() {
        CouponListPadBO result = new CouponListPadBO();
        result.totalRecord = this.totalRecord;
        result.lists = this.lists == null ? null : (List)this.lists.stream().map((e5) -> {
            return e5 == null ? null : e5.duplicate();
        }).collect(Collectors.toList());
        return result;
    }

    public String toString() {
        return Convert.toJson(this);
    }

    public Long getTotalRecord() {
        return this.totalRecord;
    }

    public void setTotalRecord(Long value) {
        this.totalRecord = value;
    }

    public CouponListPadBO withTotalRecord(Long value) {
        this.setTotalRecord(value);
        return this;
    }

    public CouponListPadBO withTotalRecord(Long value, Long defaultValue) {
        this.setTotalRecord(value == null ? defaultValue : value);
        return this;
    }

    public List<CouponPadBO> getLists() {
        if (this.lists == null) {
            this.lists = Lists.newArrayList();
        }

        return this.lists;
    }

    public void setLists(List<CouponPadBO> value) {
        this.lists = value;
    }

    public CouponListPadBO withLists(List<CouponPadBO> value) {
        this.setLists(value);
        return this;
    }

    public CouponListPadBO withLists(List<CouponPadBO> value, List<CouponPadBO> defaultValue) {
        this.setLists(value == null ? defaultValue : value);
        return this;
    }

    public CouponListPadBO addLists(CouponPadBO value) {
        if (this.lists == null) {
            this.lists = Lists.newArrayList();
        }

        this.lists.add(value);
        return this;
    }

    public Object getValueOf(String name) {
        byte var3 = -1;
        switch(name.hashCode()) {
            case -778456907:
                if (name.equals("totalRecord")) {
                    var3 = 0;
                }
                break;
            case 102982549:
                if (name.equals("lists")) {
                    var3 = 1;
                }
        }

        switch(var3) {
            case 0:
                return this.getTotalRecord();
            case 1:
                return this.getLists();
            default:
                return null;
        }
    }

    public boolean hasField(String name) {
        return FIELD_NAMES.contains(name);
    }

    public int hashCode() {
        return this.signature().hashCode();
    }

    public boolean equals(Object o) {
        return !(o instanceof CouponListPadBO) ? false : this.signature().equals(((CouponListPadBO)o).signature());
    }

    public String signature() {
        throw new RuntimeException("Bean CouponListPadBO has no signature defined, no hash code or equals possible.");
    }
}
